Export requirements automatically if heading is found

Hello together,

is there a possibility to automatically export requirements which are listed under a special topic heading . The heading should be "sensors" and everything which follows should be exported out of every project into a excel file.

For better understanding i try to show what I mean with the heading and what follows.

Example: 3.5 Sensors
3.5.1 speed sensor
3.5.2 gear sensor
.
.
.
.

Would be great if some one knows a solution for it.
Manulito - Tue Jul 05 03:19:42 EDT 2011

Re: Export requirements automatically if heading is found
llandale - Tue Jul 05 15:16:02 EDT 2011

If 'Sensors' is always section 3.5 then you can filter the module for every object in that section; specifically those objects whose "number" is exactly "3.5" or those that start with "3.5.". Then export the current module. You could also filter based on the recursive child object loop, for oChild in o do; accepting all such objects after first rejecting all objects in the module. If you get the section Object handle, you can determine if an object is therein by recursivly considering each Parent of obj, until oSection is found (true) or you have no more parents (false).

If 'Sensors' is a heading but can be anywhere, then you first find the Heading, then filter the module based on that number.

If 'Sensors' can be two headings in the module, then whatever.

bool  IsInSection(Object obj, string Section)
{     // Is the object in the section?
      // Section is the number() of the parent object, looks like "3.2.1"
    if (null obj or null Section) return(false)
    string Para = number(obj)
    if (Para == Section   or
       (length(Para) > length(Section) and Para[0:length(Section)-1] == Section)) //
    then return(true)
    else return(false)
}   // end IsInSection()
filtering off 
       // for all objects:
for obj in entire mod do
{  if (isDeleted(obj)) //
   then reject(obj)
   elseif (IsInSection(obj, "3.5") //
   then accept(obj)
   else reject(obj)
}
filtering on
        // for displayed objects:
for obj in mod do
{  export obj)
}

 

 

  • Louie